package com.itheima.test3;

import java.util.Scanner;

public class test2 {
    public static void main(String[] args) {
     Scanner sc=new Scanner(System.in);
     System.out.println("请输入字符串");
     String line=sc.nextLine();
     line=line.toLowerCase();
     int letterCount=0;
     int numberCount=0;
     for (int i=0;i<line.length();i++){
         char ch=line.charAt(i);
         if(ch>='a'&&ch<='z'){
             letterCount++;
         }else if (ch>='0'&&ch<='9'){
             numberCount++;
         }
     }
        System.out.println("字符串中英文字母有"+letterCount+"个");
        System.out.println("字符串中数字有"+numberCount+"个");
    }
}
